home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / tptsr.zip / TSR.DOC < prev    next >
Text File  |  1990-06-25  |  6KB  |  178 lines

  1. The TSR unit will take your Turbo Pascal 5.5 application and
  2. make it a TSR.  TSR stands for Terminated and Stay Resident.
  3. SideKick and SuperKey are two examples of TSR's.
  4.  
  5. Compile and run tsr.dem.  It is a simple calendar TSR.
  6. I coded it using tsr.skl for the skeleton code.  Tsr.skl
  7. is fully commented to show you how to make your own TSR.
  8. You may want to compare tsr.dem with tsr.skl. Tsr.int
  9. contains the interface section of tsr.pas.
  10.  
  11. Tsr.pas declares the MakeTSR() procedure.  One call to this
  12. procedure is all it takes to make your application a TSR.
  13.  
  14.  
  15.     type
  16.  
  17.         TSRproc = procedure;
  18.         TSRCommProc = procedure(optCh : char;
  19.             argSeg, argOfs : word);
  20.  
  21.     procedure MakeTSR(PopupOptions, PopupID : string;
  22.         HotKeyCode, HotShift : byte;
  23.         StartUp, Popup, Wrapup : TSRproc;
  24.         OptionComm : TSRCommProc);
  25.  
  26.  
  27. The first parameter, "PopupOptions", allows you to specify
  28. command line switches and/or arguments for your application.
  29. See cmdln.doc for details on specifying command line switches
  30. and arguments.
  31.  
  32. The second parameter, "PopupID", is the name you give your
  33. TSR in memory.  When your TSR is already resident and you
  34. invoke it again at the DOS command line, perhaps to pass
  35. arguments, the new copy of your TSR looks for an installed
  36. copy under this name.  If it finds it in memory already it
  37. will not install itself again.
  38.  
  39. The third and fourth parameters, "HotKeyCode" and "HotShift",
  40. specify the hotkey that will cause your TSR to popup.  Run
  41. hotkey.exe to get these values for the hotkey of your choice.
  42.  
  43. The rest of the parameters, "Startup", "Popup", "Wrapup", and
  44. "OptionComm" are procedure types that provide hooks to the TSR
  45. unit.  The TSR unit calls "Startup" only when installing itself
  46. in memory.  It calls "Popup" whenever the hotkey is pressed.
  47. It calls "Wrapup" when removing itself from memory and "OptionComm"
  48. whenever a second copy of your TSR is invoked with command line
  49. switches and/or arguments.  Tsr.skl provides further documentation
  50. on what these procedures should do using a "cookbook" approach.
  51.  
  52.  
  53.  
  54. Two variables are also defined in tsr.pas:
  55.  
  56.  
  57.     const
  58.  
  59.         TSRcolor : boolean = true;
  60.         { Popups can use this to determine color/mono modes. }
  61.  
  62.     var
  63.         TSRandPopupOptions: string;
  64.         { Popups can use this with CmdLnParams object }
  65.  
  66.  
  67. TSRcolor is set to false if the command switch "-m" for monochrome
  68. is given.  Your application should test "TSRcolor" to determine
  69. whether to popup with color or monochrome attributes.  Users of
  70. your TSR might not have color capabilities and will greatly
  71. appreciate this feature.
  72.  
  73. TSRandPopupOptions is the option specification string containing
  74. both the TSR unit options and any additional options you may
  75. have passed to MakeTSR().  This string is used to initialize the
  76. CmdLnParams object if used in your application.  See tsr.skl for
  77. a example of how to use this.  CmdLn.doc will instruct you on
  78. using the CmdLnParams object.  You don't have to use this it is
  79. provided for your convenience only.
  80.  
  81.  
  82. The following command line option switches are processed by the
  83. TSR unit (tsr below represent your application's exe filename):
  84.  
  85.  
  86.     tsr -r       to remove the TSR from memory,
  87.     tsr -d       to deactivate the TSR in memory,
  88.     tsr -a       to activate TSR in memory,
  89.     tsr -m       to force monochrome display,
  90.     tsr -c       to force color display,
  91.     tsr -kcode   code is scan code of hotkey,
  92.     tsr -sshift  shift is shift state of hotkey,
  93.     tsr -p       to popup TSR.
  94.  
  95.  
  96. Run hotkey.exe to determine scan code and shift state values.
  97. The hot key can only be redefined by your users when they are
  98. first loading your TSR and can not be changed once your TSR
  99. is resident in memory!
  100.  
  101. It may seem strange to you a first to have the "-p" switch.
  102. Suppose you have a Paradox application with a script that wants
  103. to popup a HyperText Help TSR with parameters.  Let's say your
  104. TSR application accepts an optional file name and hyperlink
  105. topic.  Then the script could issue the exec call:
  106.  
  107.     tsr -p -ffilename hypertopic
  108.  
  109. Both -ffilename hypertopic would be passed to the already
  110. resident TSR via the OptionComm() procedure.
  111.  
  112.  
  113. Go ahead and make one your applications a TSR using the TSR unit.
  114. You will notice that you can popup the TSR only 3 times.  That's
  115. because you have a shareware version.  Upon registering you will
  116. receive the source code and with the cripple flag reset.
  117.  
  118.  
  119.  
  120. This TSR shareware contains the following files:
  121.  
  122.      tsr.doc
  123.      tsr.dem
  124.      tsr.skl
  125.      tsr.int
  126.      tsr.tpu
  127.  
  128.      cmdln.doc
  129.      cmdln.dem
  130.      cmdln.int
  131.      cmdln.tpu
  132.  
  133.      crtplus.tpu
  134.  
  135.      calendar.pas
  136.  
  137.      hotkey.exe
  138.  
  139.  
  140. Shareware means try before you buy.  If you find this unit
  141. useful and are using it in your applications then your are
  142. required to register it!
  143.  
  144.  
  145. The registration fee is $20 payable to:
  146.  
  147.  
  148.     PSW / Power SoftWare
  149.     P.O. Box 10072
  150.     McLean, VA. 22102 8072
  151.  
  152.  
  153. Upon registration you will be sent the source code for
  154. tsr.pas and cmdln.pas  on a 5.25" DOS formatted diskette and
  155. be entitled to receive 15 minutes free telephone (703 759-3838)
  156. consultation on the use of tsr.pas and cmdln.pas.
  157.  
  158.  
  159. Check your favorite BBS for other shareware tools for TP 5.5
  160. from PSW:
  161.  
  162.  
  163.   omouse        $7  mouse object, primitive paint demo
  164.   graphtxt      $7  text file device driver for graphic
  165.                     modes, any font, any justification.
  166.   tpflex        $20 flexlist object, 100+ page manual
  167.                     generic stack-queue-list-array
  168.   tppan         $7  panscroller object, generic pan-scroll
  169.                     for editors, pick lists, spreadsheets,
  170.                     etc.
  171.   crtplus      $20 keyboard, cursor, and popup window
  172.                     enhancements to crt unit, 100+ page
  173.                     manual
  174.  
  175.  
  176. Thanks for supporting the shareware concept!  John
  177.  
  178.